package shell.bootstraps.controller
{
	import com.hobbit.analyze.AssetsManager;
	import com.hobbit.net.core.INetConfig;
	
	import org.robotlegs.utilities.modular.mvcs.StarlingModuleSignalCommand;
	
	public class SetupNetConfigCommand extends StarlingModuleSignalCommand
	{
		[Inject]
		public var assetsManager:AssetsManager;
		
		[Inject]
		public var netConfig:INetConfig;
		
		/**
		 * 设置通讯配置
		 * 
		 */
		public function SetupNetConfigCommand()
		{
			super();
		}
		
		override public function execute():void
		{
			var configXml:XML = XML(assetsManager.getSynPreloadRes("serverconfig", "", "xml"));
			netConfig.requestURL = configXml.url;
			netConfig.method = configXml.method;
			netConfig.dataFormat = configXml.dataFormat;
		}
	}
}